import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

export function addObj(params: object) {
  return http.request<HttpResult>("post", "/esflow/rule/function/insert", {
    data: params
  });
}

export function delObjs(ids: string) {
  return http.request<HttpResult>(
    "post",
    `/esflow/rule/function/delete/${ids}`
  );
}

export function updateObj(params: object) {
  return http.request<HttpResult>("post", "/esflow/rule/function/update", {
    data: params
  });
}

export function getObj(id: string) {
  return http.request<HttpResult>("get", `/esflow/rule/function/get/${id}`);
}

export function queryTable(params: object) {
  return http.request<HttpResult>("get", "/esflow/rule/function/get/table", {
    params: params
  });
}

export function queryList(params: object) {
  return http.request<HttpResult>("get", "/esflow/rule/function/get/list", {
    params: params
  });
}
